import React from "react";
import ReactDOM from "react-dom";
import HelloA from "./PropStu1";


class HelloB extends React.Component{
    state={
        attr:'生活',
        attr1:"shopping"
    }

    componentDidMount(){
        this.setState({ attr: '人间', attr1: "lalal"})
    }
    render(){
        const element = <HelloA/>

        return <div>
            {/* HelloB调用HelloA */}
            组件互相调用 HelloB调用HelloA
            <HelloA attr={this.state.attr} attr1={this.state.attr1} style={{backgroundColor:"red"}} history={this.props.history}/>
            元素调用组件element
            {element}
          </div>;
    }
}
export default HelloB;
